package Template5::Element::Attr;
use base qw(Template5::Element::Templinsert);

#-------------------------------------------------------------------------------
use strict;
use warnings;

#-------------------------------------------------------------------------------
use Template5::Saver;

#-------------------------------------------------------------------------------
sub new($$)
{
	my $class      = shift;
	my $hHTMLNode  = shift;
	my $params     = shift; 	

	my $this = $class->SUPER::new($hHTMLNode, $params);
	my $cond = $this->{'htmlnode'}->attr('cond');
	
	$this->{'name'} = $this->{'htmlnode'}->attr('name');	
	
	if(defined($cond))
	{		
		$this->{'cond'}     = $cond;
		$this->{'havethis'} = 0; 
	};
	
	push(@{$this->{'allowed_attrs'}}, 'name'); 
	
	return $this;
};

#-------------------------------------------------------------------------------
#public
sub getstruct()
{
	my $this   = shift;
	my $retVal = $this->SUPER::getstruct();

	$retVal->attr('_saver:element', Template5::Saver->new({'id' => 1, 'type' => 1, 'name' => 1, 'cond' => 1, 'skip' => 0, 'inherited' => 0, 'nonautoid' => 0, 'inline' => 0, 'notvisible' => 0}));	
	return $retVal;
};

1;

